// src/store/slices/summarySlice.ts
import { createSlice, PayloadAction } from '@reduxjs/toolkit';

interface SummaryState {
  userCount: number;
  componentCount: number;
  languageCount: number;
}

const initialState: SummaryState = {
  userCount: 0,
  componentCount: 0,
  languageCount: 0,
};

const summarySlice = createSlice({
  name: 'summary',
  initialState,
  reducers: {
    setUserCount: (state, action: PayloadAction<number>) => {
      state.userCount = action.payload;
    },
    setComponentCount: (state, action: PayloadAction<number>) => {
      state.componentCount = action.payload;
    },
    setLanguageCount: (state, action: PayloadAction<number>) => {
      state.languageCount = action.payload;
    },
  },
});

export const { setUserCount, setComponentCount, setLanguageCount } = summarySlice.actions;
export default summarySlice.reducer;